<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>


<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>LigerUI</title>
<!-- Bootstrap -->
<link href="lib/ligerUI/skins/Aqua/css/ligerui-all.css" rel="stylesheet">
<link href="lib/ligerUI/skins/ligerui-icons.css" rel="stylesheet">
</head>
<body>
<div id="toolbar"></div>
<div id="maingrid"></div>

<script type="text/javascript" src="lib/jquery/jquery-1.9.0.min.js"></script>
<!-- <script type="text/javascript" src="lib/ligerUI/js/core/base.js"></script> -->
<script type="text/javascript" src="lib/ligerUI/js/ligerui.all.js"></script>
<script type="text/javascript">
	var data = [
	            	{id:1,name:'吴飞林',sex:'男',age:31},
	            	{id:2,name:'张三',sex:'男',age:31},
	            	{id:3,name:'李四',sex:'男',age:31},
	            	{id:4,name:'王麻子',sex:'男',age:31}
	            ];
	var gridManager = null;
	
	$('#toolbar').ligerToolBar({
		items: [
                 { text: '增加', click: itemclick, icon:'add'},
                 { line:true },
                 { text: '修改', click: itemclick, icon:'edit'},
                 { line:true },
                 { text: '删除', click: itemclick, icon:'delete'}
             ]
	});
	
	function itemclick() {
		alert(this.text);
		switch (id) {
		case 1:			
		case 2:
		case 3:
			alert(this.text);
			break;
		default:
			null;
		}
	}
	
	gridManager = $('#maingrid').ligerGrid({
		columns: [
		         	{display:'id', name:'id', width: 80, align:'center'} ,
		         	{display:'name', name:'name', width: 120, align:'center'} ,
		         	{display:'sex', name:'sex', width: 80, align:'center'} ,
		         	{display:'age', name:'age', width: 80, align:'center'} 
		         ],
		 url: '/source',
	     width:"100%",
	     height:"96%",
	     method: 'get',
		 rownumbers:true,
		 onReload: f_reload
	});
	
	function f_reload() {
		//alert('r');
		gridManager.loadData({
			
		})
	}

</script>
</body>
</html>